import React, {useEffect, useState} from 'react';

const List = ({text}) => {

  const [data,setData] = useState([])

  useEffect(()=>{
    const data = []
    data.length = 5000
    for (let i = 0; i < data.length; i++) {
      data.fill(i + 1, i)
    }
    setData(data)

  }, [text])

  return (
    <div>
      {data.map(item => {
        return <p key={item}>{text}</p>
      })}
    </div>
  );
};

export default List;
